Carbon


TestControl

Header: Controls.h Carbon status: Supported

Obtains the control part in which a mouse-down event occurred.

ControlPartCode TestControl (
    ControlRef theControl, 
    Point testPoint
);
theControl

A handle to the control in which the mouse-down event occurred.

testPoint

The point, in a window’s local coordinates, where the mouse-down event occurred.

function result

The part code of the control part, or 0 if the point is outside the control; see “Meta Control Part Code Constants”, “Control Part Code Constants”, and “Control State Part Code Constants”. If the control is invisible or inactive, TestControl returns 0.

DISCUSSION

The TestControl function is called by the FindControl and TrackControl functions; your application does not normally call it.

When the control specified by the parameter theControl is visible and active, TestControl tests which part of the control contains the point specified by the parameter testPoint.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)